package com.zhuojy.equity.mall.admin.web.controller.car;

import com.zhuojy.equity.mall.admin.common.entity.po.car.TCarFuelCardReleasePO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.car.TCarFuelcardReleaseService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xrz
 * @version 1.0
 * @description:TODO
 * @date 2024/4/1 20:48
 */
@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("carfuelcardrelease")
public class TCarFuelcardReleaseController {
    @Autowired
    private TCarFuelcardReleaseService tCarFuelcardReleaseService;

    /**
     * 查询油卡充值记录
     * @param TCarFuelCardReleasePO
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping("findcarfuelcardrelease")
    private ResultEntity findcarfuelcardrelease(@RequestBody TCarFuelCardReleasePO TCarFuelCardReleasePO, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum,@RequestParam("type") Integer type){
        return tCarFuelcardReleaseService.findcarfuelcardrelease(TCarFuelCardReleasePO, pageSize, pageNum,type);
    }

    /**
     * 根据id删除信息
     * @param id
     * @return
     */
    @RequestMapping("delById")
    private ResultEntity delById(@RequestParam("id")Integer id){
        return tCarFuelcardReleaseService.delById(id);
    }


    /**
     * 添加信息
     * @param tCarFuelCardReleasePO
     * @return
     */
    @RequestMapping("addtCarFuelCardRelease")
    private ResultEntity addtCarFuelCardRelease(@RequestBody TCarFuelCardReleasePO tCarFuelCardReleasePO){
        return tCarFuelcardReleaseService.addtCarFuelCardRelease(tCarFuelCardReleasePO);
    }
}
